
function page(n) {
    let city = "";
    if ($(".search_input").val() != "") {
        city = $('.search_input').val();
    } else {
        city = $(".citychoosed").text();
    }
    let peo = $(".peochoosed").text();
    let col = $(".colchoosed").text();
    if (city == "全国") {
        city = ""
    }
    switch (peo) {
        case "全部":
            peo = "";
            break
        case "0-20人":
            peo = 0;
            break;
        case "20-99人":
            peo = 1;
            break;
        case "100-499人":
            peo = 2;
            break;
        case "500-999人":
            peo = 3;
            break;
        case "1000-9999人":
            peo = 4;
            break;
        case "10000人以上":
            peo = 5;
            break;
    }
    switch (col) {
        case "全部":
            col = "";
            break
        case "未融资":
            col = 0;
            break;
        case "天使轮":
            col = 1;
            break;
        case "A轮":
            col = 2;
            break;
        case "B轮":
            col = 3;
            break;
        case "C轮":
            col = 4;
            break;
        case "D轮及以上":
            col = 5;
            break;
        case "已上市":
            col = 6;
            break;
        case "不需要融资":
            col = 7;
            break;
    }
    $(".companyMsg").load('/dev/company/allpage?pageNum=' + n + '&city=' + city + '&collectMoneyState=' + col + "&peopleCounts=" + peo);
}


function searchButton() {
    $(".citychoosed").removeClass("citychoosed");
    let city = $(".search_input").val();
    let peo = $(".peochoosed").text();
    let col = $(".colchoosed").text();
    switch (peo) {
        case "全部":
            peo = "";
            break
        case "0-20人":
            peo = 0;
            break;
        case "20-99人":
            peo = 1;
            break;
        case "100-499人":
            peo = 2;
            break;
        case "500-999人":
            peo = 3;
            break;
        case "1000-9999人":
            peo = 4;
            break;
        case "10000人以上":
            peo = 5;
            break;
    }
    switch (col) {
        case "全部":
            col = "";
            break
        case "未融资":
            col = 0;
            break;
        case "天使轮":
            col = 1;
            break;
        case "A轮":
            col = 2;
            break;
        case "B轮":
            col = 3;
            break;
        case "C轮":
            col = 4;
            break;
        case "D轮及以上":
            col = 5;
            break;
        case "已上市":
            col = 6;
            break;
        case "不需要融资":
            col = 7;
            break;
    }
    $(".companyMsg").load('/dev/company/allpage?pageNum=1' + '&city=' + city + '&collectMoneyState=' + col + "&peopleCounts=" + peo);
}


function searchCondition(ele) {
    let className = $(ele).parent().parent().attr('class');
    if (className == "area_city") {
        $(".citychoosed").removeClass("citychoosed");
        $(ele).addClass("citychoosed");
        let city = "";
        if ($(".search_input").val() != "") {
            $(".search_input").val("");
        }
        city = $(".citychoosed").text();
        if (city == "全国") {
            city = ""
        }
        let peo = $(".peochoosed").text();
        let col = $(".colchoosed").text();
        switch (peo) {
            case "全部":
                peo = "";
                break
            case "0-20人":
                peo = 0;
                break;
            case "20-99人":
                peo = 1;
                break;
            case "100-499人":
                peo = 2;
                break;
            case "500-999人":
                peo = 3;
                break;
            case "1000-9999人":
                peo = 4;
                break;
            case "10000人以上":
                peo = 5;
                break;
        }
        switch (col) {
            case "全部":
                col = "";
                break
            case "未融资":
                col = 0;
                break;
            case "天使轮":
                col = 1;
                break;
            case "A轮":
                col = 2;
                break;
            case "B轮":
                col = 3;
                break;
            case "C轮":
                col = 4;
                break;
            case "D轮及以上":
                col = 5;
                break;
            case "已上市":
                col = 6;
                break;
            case "不需要融资":
                col = 7;
                break;
        }
        $(".companyMsg").load('/dev/company/allpage?pageNum=1&city=' + city + '&collectMoneyState=' + col + "&peopleCounts=" + peo);
    } else if (className == "collect_money_state") {
        $(".colchoosed").removeClass("colchoosed");
        $(ele).addClass("colchoosed");
        let city = $(".citychoosed").text();
        let peo = $(".peochoosed").text();
        let col = $(".colchoosed").text();
        if (city == "全国") {
            city = ""
        }
        switch (peo) {
            case "全部":
                peo = "";
                break
            case "0-20人":
                peo = 0;
                break;
            case "20-99人":
                peo = 1;
                break;
            case "100-499人":
                peo = 2;
                break;
            case "500-999人":
                peo = 3;
                break;
            case "1000-9999人":
                peo = 4;
                break;
            case "10000人以上":
                peo = 5;
                break;
        }
        switch (col) {
            case "全部":
                col = "";
                break
            case "未融资":
                col = 0;
                break;
            case "天使轮":
                col = 1;
                break;
            case "A轮":
                col = 2;
                break;
            case "B轮":
                col = 3;
                break;
            case "C轮":
                col = 4;
                break;
            case "D轮及以上":
                col = 5;
                break;
            case "已上市":
                col = 6;
                break;
            case "不需要融资":
                col = 7;
                break;
        }
        city = decodeURI(city)
        $(".companyMsg").load('/dev/company/allpage?pageNum=1&city=' + city + '&collectMoneyState=' + col + "&peopleCounts=" + peo);
    } else if (className == "people_counts") {
        $(".peochoosed").removeClass("peochoosed");
        $(ele).addClass("peochoosed");
        let city = $(".citychoosed").text();
        let peo = $(".peochoosed").text();
        let col = $(".colchoosed").text();
        if (city == "全国") {
            city = ""
        }
        switch (peo) {
            case "全部":
                peo = "";
                break
            case "0-20人":
                peo = 0;
                break;
            case "20-99人":
                peo = 1;
                break;
            case "100-499人":
                peo = 2;
                break;
            case "500-999人":
                peo = 3;
                break;
            case "1000-9999人":
                peo = 4;
                break;
            case "10000人以上":
                peo = 5;
                break;
        }
        switch (col) {
            case "全部":
                col = "";
                break
            case "未融资":
                col = 0;
                break;
            case "天使轮":
                col = 1;
                break;
            case "A轮":
                col = 2;
                break;
            case "B轮":
                col = 3;
                break;
            case "C轮":
                col = 4;
                break;
            case "D轮及以上":
                col = 5;
                break;
            case "已上市":
                col = 6;
                break;
            case "不需要融资":
                col = 7;
                break;
        }
        city = decodeURI(city)
        $(".companyMsg").load('/dev/company/allpage?pageNum=1&city=' + city + '&collectMoneyState=' + col + "&peopleCounts=" + peo);
    }

}

function companyMsg(id){
    // window.location.replace('/dev/company/msg?id='+id)
    window.location.href = 'msg?id='+id;
    // window.load('/dev/company/msg?id='+id)
}

